workspace(name = "rules_python_multi_python_versions")

local_repository(
    name = "rules_python",
    path = "../..",
)

load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_multi_toolchains")

py_repositories()

default_python_version = "3.9"

python_register_multi_toolchains(
    name = "python",
    default_version = default_python_version,
    python_versions = [
        "3.8",
        "3.9",
        "3.10",
        "3.11",
    ],
    register_coverage_tool = True,
)

load("@python//:pip.bzl", "multi_pip_parse")

multi_pip_parse(
    name = "pypi",
    default_version = default_python_version,
    python_interpreter_target = {
        "3.10": "@python_3_10_host//:python",
        "3.11": "@python_3_11_host//:python",
        "3.8": "@python_3_8_host//:python",
        "3.9": "@python_3_9_host//:python",
    },
    requirements_lock = {
        "3.10": "//requirements:requirements_lock_3_10.txt",
        "3.11": "//requirements:requirements_lock_3_11.txt",
        "3.8": "//requirements:requirements_lock_3_8.txt",
        "3.9": "//requirements:requirements_lock_3_9.txt",
    },
)

load("@pypi//:requirements.bzl", "install_deps")

install_deps()

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# See https://github.com/bazelbuild/rules_shell/releases/tag/v0.2.0
http_archive(
    name = "rules_shell",
    sha256 = "410e8ff32e018b9efd2743507e7595c26e2628567c42224411ff533b57d27c28",
    strip_prefix = "rules_shell-0.2.0",
    url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.2.0/rules_shell-v0.2.0.tar.gz",
)

load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains")

rules_shell_dependencies()

rules_shell_toolchains()
